package lab02.test03;

public class Student {

    //属性math、english、computer
    int math;
    int english;
    int computer;

    //求总分函数
    public int sum(int math, int english, int computer) {
        int sum = math + english + computer;
        return sum;
    }

    //求平均分
    public int average(int math, int english, int computer) {
        int average = (math + english + computer) / 3;
        return average;
    }

    //求最高分
    public int max(int math, int english, int computer) {
        int max = math;
        if (max < english) {
            max = english;
            if (max < computer) {
                max = computer;
            }
        }
        if (max < computer) {
            max = computer;
        }
        return max;
    }

    public int min(int math, int english, int computer) {
        int min = math;
        if (min > english) {
            min = english;
            if (min > computer) {
                min = computer;
            }
        }
        if (min < computer) {
            min = computer;
        }
        return min;
    }

}

